package com.example.springboot.demo1.service.impl;

import com.example.springboot.demo1.SpringData.dao.UserRepository;
import com.example.springboot.demo1.SpringData.domain.User;
import com.example.springboot.demo1.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserRepository userRepository;
    @Override
    public void save(User user) {
        userRepository.save(user);

    }

    @Override
    public List<User> findAll() {
        List<User> all = userRepository.findAll();
        return all;
    }
}
